package com.lengchangjing.BehavioralPatterns.InterpreterPattern;

public class Client {
    public static void main(String[] args) {
        Context context = new Context();
        context.Assign("1", "左边");
        context.Assign("2", "and");
        context.Assign("3", "右边");

        AbstractExpression left = new TerminalExpression("1");
        AbstractExpression right = new TerminalExpression("3");
        AbstractExpression expression = new NonterminalExpression(left, right);

        String e = expression.Interpret(context);
        System.out.println(e);

    }
}
